<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><!-- 核心标签是最常用的JSTL标签 -->
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%><!-- 包含一系列标准函数,大部分 是通用的字符串处理函数 -->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%><!-- 格式化并输出文本、日期、时间、数字 -->
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
<head>
<title>房间数据统计</title>
<base href="<%=basePath%>" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="apple-touch-icon-precomposed" href="i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<link rel="stylesheet" href="css/MyCSS.css">
<!-- 适应所有设备 -->
<style type="text/css">
html, body {
	height: 100%;
	margin: 0;
	padding: 0;
}
</style>
</head>
<body>
        <br/>
		<table class="layui-table" id="Three3DFishingRoom" lay-filter="ThreeFishingRoom">
        <caption style="color:#f47920;">3D捕鱼</caption>
		</table>
		<br/>
		<table class="layui-table" id="LbjRoom" lay-filter="LbjRoom">
        <caption style="color:#f47920;">拉霸机</caption>
		</table>
		<br/>
		<table class="layui-table" id="DdsRoom" lay-filter="DdsRoom">
        <caption style="color:#f47920;">打地鼠</caption>
		</table>
		<br/>
		<table class="layui-table" id="LhdRoom" lay-filter="LhdRoom">
        <caption style="color:#f47920;">龙虎斗</caption>
		</table>
		<br/>
		<table class="layui-table" id="XgnlRoom" lay-filter="XgnlRoom">
        <caption style="color:#f47920;">性感女郎</caption>
		</table>
	
	<script src="js/jquery.min.js"></script>
	<script src="layui/layui.js"></script>
	
	<script id="Three3Dfishing" type="text/html">
        {{# d.Three3Dfishing = parseInt(d.Three3Dfishingwin) + d.Three3Dfishingtransport}}
           <span>{{d.Three3Dfishing}}</span>
        {{# }}
    </script>
    <script id="Lbj" type="text/html">
        {{# d.Lbj = parseInt(d.Lbjwin) + d.Lbjtransport}}
           <span>{{d.Lbj}}</span>
        {{# }}
    </script>
    <script id="Dds" type="text/html">
        {{# d.Dds = parseInt(d.Ddswin) + d.Ddstransport}}
           <span>{{d.Dds}}</span>
        {{# }}
    </script>
    <script id="Lhd" type="text/html">
        {{# d.Lhd = parseInt(d.Lhdwin) + d.Lhdtransport}}
           <span>{{d.Lhd}}</span>
        {{# }}
    </script>
    <script id="Xgnl" type="text/html">
        {{# d.Xgnl = parseInt(d.Xgnlwin) + d.Xgnltransport}}
           <span>{{d.Xgnl}}</span>
        {{# }}
    </script>
    
	<script>
	  layui.use(['layer','table','element','form'],function(){
        var layer = layui.layer
  	    ,table = layui.table
  	    ,element = layui.element
  	    ,form = layui.form;
        
        var data;
      	$(document).ready(function(){
      		$.ajax({
      			type:"POST",
      			url:'stat/gamedata',
      			async:false,
      			success:function(resp){
      				data=JSON.parse(resp);
      			}
      		});
      	});
      	
        table.render({
        	elem:'#Three3DFishingRoom',
        	method:'POST',
        	totalRow:true,
        	id:'Alltable1',
        	cols:[[
        	  {field : 'Three3Dfishing',title : '捕鱼3D输赢',templet:'#Three3Dfishing'},
  			  {field : 'Three3Dfishingwin',title : '捕鱼3D赢',hide:true}, 
  			  {field : 'Three3Dfishingtransport',title : '捕鱼3D输',hide:true}
    		  ]],
    		  data:data.data
        });
        
        table.render({
        	elem:'#LbjRoom',
        	method:'POST',
        	totalRow:true,
        	id:'Alltable3',
        	cols:[[
        		{field : 'Lbj',title : '拉霸机输赢',templet:'#Lbj'},
    			{field : 'Lbjwin',title : '拉霸机赢',hide:true}, 
    			{field : 'Lbjtransport',title : '拉霸机输',hide:true}
    		  ]],
    		  data:data.data
        });
        
        table.render({
        	elem:'#DdsRoom',
        	method:'POST',
        	totalRow:true,
        	id:'Alltable5',
        	cols:[[
        		{field : 'Dds',title : '打地鼠输赢',templet:'#Dds'},
    			{field : 'Ddswin',title : '打地鼠赢',hide:true}, 
    			{field : 'Ddstransport',title : '打地鼠输',hide:true}
    		  ]],
    		  data:data.data
        });
      
        
        table.render({
        	elem:'#LhdRoom',
        	method:'POST',
        	totalRow:true,
        	id:'Alltable6',
        	cols:[[
        		{field : 'Lhd',title : '龙虎斗输赢',templet:'#Lhd'},
    			{field : 'Lhdwin',title : '龙虎斗赢',hide:true}, 
    			{field : 'Lhdtransport',title : '龙虎斗输',hide:true}
    		  ]],
    		  data:data.data
        });
        
        table.render({
        	elem:'#XgnlRoom',
        	method:'POST',
        	totalRow:true,
        	id:'Alltable9',
        	cols:[[
        		{field : 'Xgnl',title : '性感女郎输赢',templet:'#Xgnl'},
    			{field : 'Xgnlwin',title : '性感女郎赢',hide:true}, 
    			{field : 'Xgnltransport',title : '性感女郎输',hide:true}
    		  ]],
    		  data:data.data
        });
        
        setInterval(function(){
        	table.reload('Alltable1');
        	table.reload('Alltable3');
        	table.reload('Alltable4');
        	table.reload('Alltable5');
        	table.reload('Alltable6');
        	table.reload('Alltable7');
        	table.reload('Alltable8');
        	table.reload('Alltable9');
        	table.reload('Alltable10');
        	table.reload('Alltable11');
        	table.reload('Alltable12');
        	table.reload('Alltable13');
        	table.reload('Alltable14');
        	table.reload('Alltable15');
        },60000);
	  });
	</script>
	
</body>
</html>